{include file="publics/head"/}
<body class="no-skin">
{include file="publics/header"/}
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    {include file="publics/sidebar"/}
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            {include file="publics/breadcrumbs"/}

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                {include file="publics/set"/}

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal"  id="categoryForm">
                            <input name="banner_id" id="banner_id" value="{$banner.banner_id}" type="hidden">
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="banner_title"> Banner名称 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="banner_title" id="banner_title" placeholder="banner名称"
                                           class="col-xs-10 col-sm-5" value="{$banner.banner_title}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">banner名称，不能为空。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="banner_url"> Banner链接 </label>
                                <div class="col-sm-9">
                                    <input type="text" name="banner_url" id="banner_url" placeholder="请输入友链链接"
                                           class="col-xs-10 col-sm-5" value="{$banner.banner_url}">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">Banner链接(需要'http','https')。</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="banner_img">
                                    banner图片 </label>
                                <div class="col-sm-9">
                                    <div class="col-xs-10 col-sm-5">
                                        {:upImage("banner_img",100,100,$banner['banner_img'])}
                                    </div>
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">仅支持jpg、gif、png、bmp、jpeg，且小于1MB。</span>
											</span>
                                </div>

                            </div>
                            <div class="col-md-offset-2 col-md-9">
                                <button class="btn btn-info submit" type="button" id="banner_submit">
                                    <i class="icon-ok bigger-110"></i>
                                    提交
                                </button>

                                &nbsp; &nbsp; &nbsp;
                                <button class="btn" type="reset">
                                    <i class="icon-undo bigger-110"></i>
                                    重置
                                </button>
                            </div>
                        </form>
                <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
             </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
{include file="publics/footer"/}

</div><!-- /.main-container -->

{include file="publics/footerjs"/}
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {
        
        $("#banner_submit").click(function () {
        	$.ajax({
            	type:"post",
            	url:"{:url('update')}",
            	data:$('#categoryForm').serializeArray(),
            	//dataType:"",
            	error:function(){
            		return false;
            	},
            	success:function(data){
            		//console.log(data);
            		bootbox.alert({  
                        buttons: {  
                           ok: {label: '确定',className: 'btn-danger'}  
                        },  
                        message: data.message,  
                        callback: function() {  
                            if(data.flag == 0){
                          			location.reload(); 
                          		}
                        },  
                        title: "系统提示",  
                    }); 
            	}
            });
        });
    })
</script>
</body>
</html>
